package model

import (
	"exam-pro/api-getaway/basic/config"
	"gorm.io/gorm"
)

type User struct {
	gorm.Model
	Username string `gorm:"type:varchar(30);comment:用户名"`
	Password string `gorm:"type:char(32);comment:密码"`
	Name     string `gorm:"type:varchar(30);comment:真实姓名"`
	Email    string `gorm:"type:varchar(18);comment:邮箱"`
	Tel      string `gorm:"type:char(11);comment:手机号"`
	ImageUrl string `gorm:"type:varchar(300);comment:头像"`
}

func Register(data *User) error {

	return config.DB.Create(data).Error
}
